package com.ruoyi.graduate.domain.vo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.catalina.LifecycleState;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.List;

@Data
@ApiModel("用户端留言返回实体类")
public class MsMessageBoardUserPageVo {

    @ApiModelProperty(value = "留言唯一标识（自增主键）")
    private Integer messageId;

    @ApiModelProperty(value = "父留言ID（0表示一级留言，非0表示次级留言）") // 新增：标识父级
    private Integer parentId;

    @ApiModelProperty(value = "留言用户ID（外键，关联ms_sys_user表的user_id，必填）")
    private Long userId;

    @ApiModelProperty(value = "留言用户名")
    private String userName;

    @ApiModelProperty(value = "头像地址")
    private String avatar;

    @ApiModelProperty(value = "留言内容（必填）")
    private String messageContent;

    @ApiModelProperty(value = "留言图片路径（可选）")
    private String imgUrl;

    @ApiModelProperty(value = "留言时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "次级评论列表（子留言）")
    private List<MsMessageBoardUserPageVo> children; // 已有：存储子评论
}